package cn.zyjblogs.config;

import org.springframework.cloud.netflix.zuul.filters.discovery.PatternServiceRouteMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * copyright (C), 2020, 北京同创永益科技发展有限公司
 *
 * @author zhuyijun
 * @version 1.0.0
 * <author>              <time>                 <version>                   <description>
 * zhuyijun         2020/11/12 13:42             1.0
 * @program springcloud
 * @description
 * @create 2020/11/12 13:42
 */
@Configuration
public class ZuulConfig {
    @Bean
    public PatternServiceRouteMapper serviceRouteMapper() {
        return new PatternServiceRouteMapper(
                "(?<name>^.+)-(?<version>v.+$)",
                "${version}/${name}");
        //服务名-v版本
        //    /v版本/路径
    }
}
